import request from '@/utils/request'

// 获取评审列表数据
export function getProjectContract(query) {
  return request({
    url: '/lims/project/report/list',
    method: 'get',
    params: query
  })
}

// 获取方案表单数据
export function getProjectForm(projectId) {
  return request({
    url: '/lims/contract/project/' + projectId,
    method: 'get',
  })
}

// 获取方案表单数据
export function batchReview(projectIds) {
  return request({
    url: '/lims/contract/project/submitProject/' + projectIds,
    method: 'post',
  })
}

// 获取方案详情检测内容列表数据
export function getProjectJcxmList(query) {
  return request({
    url: '/lims/project/jcxm/list',
    method: 'get',
    params: query
  })
}

// 检测内容列表保存接口
export function addProjectJcxmList(data) {
  return request({
    url: '/lims/project/jcxm',
    method: 'post',
    data: data
  })
}

// 保存打印记录
export function addReportPrintRecord(reportId) {
  return request({
    url: '/lims/project/report/print?reportId=' + reportId,
    method: 'post'
  })
}

// 详情时间编辑保存
export function addEiditProject(data) {
  return request({
      url: '/lims/contract/project',
      method: 'put',
      data: data
  })
}

// 获取报告模板下拉框
export function getTemplateList() {
  return request({
    url: '/report/template/templateList',
    method: 'get',
  })
}

// 生成报告完成后返回 fileId和fileName  根据这两个参数查询 pageOffice 文档
export function getFile(query) {
  return request({
    url: '/lims/reportData/generateWord',
    method: 'get',
    params: query,
    isTimeOut: 30000
  })
}

// 打开pageOffice
export function viewForm(query) {
  return request({
    url: '/report/word/openFile',
    method: 'get',
    params: query
  })
}

// 签字时打开pageOffice
export function viewSignForm(query) {
  return request({
    url: '/report/word/sign',
    method: 'get',
    params: query
  })
}

// 打开pageOffice
export function viewFormFlow(query) {
  return request({
    url: '/report/word/openFileFlow',
    method: 'get',
    params: query
  })
}

// 查询历史记录
export function getHistoryList(query) {
  return request({
    url: '/report/word/reportList',
    method: 'get',
    params: query
  })
}

export function querySelecteModifyList(query) {
  return request({
    url: '/report/word/seleteModifyList',
    method: 'get',
    params: query
  })
}

export function updateModifyStatus(data) {
  return request({
    url: '/report/word/updateModifyStatus',
    method: 'put',
    data: data
  })
}

export function insertReportFile(data) {
  return request({
    url: '/report/word/',
    method: 'post',
    data: data
  })
}

export function createAchvieFile(reportId) {
  return request({
    url: '/lims/projectArchive/createAchvieFile/' + reportId,
    method: 'post'
  })
}


